# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kpat
pkgver=20.04.3
pkgrel=0
pkgdesc="KPatience offers a selection of solitaire card games"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://kde.org/applications/games/kpat/"
license="GPL-2.0-or-later AND GFDL-1.2-only"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtsvg-dev kcompletion-dev kconfig-dev kconfigwidgets-dev kcoreaddons-dev kcrash-dev kdbusaddons-dev kdoctools-dev kguiaddons-dev ki18n-dev kio-dev knewstuff-dev kwidgetsaddons-dev kxmlgui-dev libkdegames-dev freecell-solver-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/kpat-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="d178a1360b37acdbba9fa33de56929b51c19b81ff6ee01d3f8780fe507800d9c9c1155bd0ae4e2f8b6baff5410133020c113aa6ed3f86aee2238f448216ce7ad  kpat-20.04.3.tar.xz"
